package com.user.controller;

import com.apis.UserRealname.AdUserControllerApi;
import com.user.service.UserServiceipl;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.user.dtos.AuthDto;
import com.usian.model.user.pojos.UserConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



@RequestMapping("/user/api/v1/apuser")
@RestController
public class UserController implements AdUserControllerApi {

    @Autowired
    private UserServiceipl serviceipl;

    /**
     *
     * @param dto
     * @return
     */
    @PostMapping("list")
    @Override
    public ResponseResult list(@RequestBody AuthDto dto) {
        return serviceipl.list(dto);
    }

    @PostMapping("/Pass")
    @Override
    public ResponseResult pass(@RequestBody  AuthDto dto) {
        return serviceipl.update(dto, UserConstants.PASS_AUTH);
    }

    @PostMapping("/Fail")
    @Override
    public ResponseResult fail(@RequestBody AuthDto dto) {
        return serviceipl.update(dto, UserConstants.FAIL_AUTH);
    }



}
